using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Criterion;

using QLTDK.Entities;
using QLTDK.DataAccess.Interfaces.BaseInterfaces;
using QLTDK.DataAccess.Base;

namespace QLTDK.DataAccess.BaseDaos
{
    public class BaseTdkCaptdktheokichthuocDao : NHibernateDao<TdkCaptdktheokichthuoc, int>, IBaseTdkCaptdktheokichthuocDao
    {
		#region Constructors
		
		public BaseTdkCaptdktheokichthuocDao() : base()
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<TdkCaptdktheokichthuoc> GetByMaLoaiCapTDK(System.Int32 maLoaiCapTDK)
        {
			return HibernateTemplate.ExecuteFind<TdkCaptdktheokichthuoc>(

			    delegate(ISession session)
				{
					ICriteria criteria = session.CreateCriteria(typeof(TdkCaptdktheokichthuoc));
					
					
					ICriteria maLoaiCapTDKCriteria = criteria.CreateCriteria("MaLoaiCapTDK");
					maLoaiCapTDKCriteria.Add(Expression.Eq("Id", maLoaiCapTDK));
					
					return criteria.List<TdkCaptdktheokichthuoc>();
				});
        }
		
		public IList<TdkCaptdktheokichthuoc> GetByMaTDK(System.Int32 maTDK)
        {
			return HibernateTemplate.ExecuteFind<TdkCaptdktheokichthuoc>(

			    delegate(ISession session)
				{
					ICriteria criteria = session.CreateCriteria(typeof(TdkCaptdktheokichthuoc));
					
					
					ICriteria maTDKCriteria = criteria.CreateCriteria("MaTDK");
					maTDKCriteria.Add(Expression.Eq("Id", maTDK));
					
					return criteria.List<TdkCaptdktheokichthuoc>();
				});
        }
		
		#endregion
    }
}